import { views } from '@/pages/index';
import { EnumLayoutComponentName } from '@/enum';
import type { LayoutComponentName } from '@/interface';
type LayoutComponent = Record<LayoutComponentName, () => Promise<any>>;
/**
 * 获取页面导入的文件(懒加载的方式)
 * @param routeKey - 路由key
 */
export function getViewComponent(routeKey: AuthRoute.RouteKey) {
  return views[routeKey];
}

/**
 * 获取页面导入的文件(懒加载的方式)
 * @param layoutType - 布局类型
 */
export function getLayoutComponent() {
  const layoutComponent: LayoutComponent = {
    basic: () => import('@/components/PageLayout'),
  };
  return layoutComponent.basic;
}
